{
	"Tests":[
		{
			"Value":"/", 
			"ExpectedValue":"/{GatewaySubdir}",
			"Comments":"Testing relative to the root"
		},
		{
			"Value":"http://localtest.me/foo/bar.aspx?id=12345&name=Fabricam",
			"ExpectedValue": "http://localtest.me/foo/bar.aspx?id=12345&name=Fabricam",
			Comments:"An unrelated domain should be ignored."
		},
		{
			"Value":"//{WebServerDomain}/",
			"ExpectedValue": "//{GatewayServerDomain}/{GatewaySubdir}",
			Comments:"Protcol relative URLs should be updated too."
		},
		{
			"Value":"//www.google.com",
			"ExpectedValue": "//www.google.com",
			Comments:"Protocol relative URLs that aren't related should be left alone."
		},
		{
			"Value":"http://{WebServerDomain}",
			"ExpectedValue": "http://{GatewayServerDomain}/{GatewaySubdir}",
			Comments:"For FQDNs the domain name and subdir should be updated."
		},
		{
			"Value":"http://{WebServerDomain}/foo",
			"ExpectedValue": "http://{GatewayServerDomain}/{GatewaySubdir}foo",
			Comments:"Testing without a trailing slash."
		},
		{
			"Value":"http://{WebServerDomain}/foo/",
			"ExpectedValue": "http://{GatewayServerDomain}/{GatewaySubdir}foo/",
			Comments:"Testing with a trailing slash."
		},
		{
			"Value":"https://{WebServerDomain}:443/foo",
			"ExpectedValue": "https://{GatewayServerDomain}/{GatewaySubdir}foo",
			Comments:"Testing with https and with the port in the URL."
		},
		{
			"Value":"https://{WebServerDomain}:443",
			"ExpectedValue": "https://{GatewayServerDomain}/{GatewaySubdir}",
			Comments:"Testing with a FQDN, default doc without a starting slash."
		},
		{
			"Value":"foo/bar",
			"ExpectedValue": "foo/bar",
			Comments:"Fully relative URLs should be left untouched"
		},
		{
			"Value":"/foo/
			bar",
			"ExpectedValue": "/{GatewaySubdir}foo/
			bar",
			Comments:"Testing with a line break. Note, the break shows as a space."
		},
		
		
		
		
		{
			"Value":"http://login.asp.net/login/signout.aspx?ReturnUrl=http://www.asp.net/",
			"ExpectedValue": "http://login.asp.net/login/signout.aspx?ReturnUrl=http://www.asp.net/",
			Comments:"The ReturnUrl should not be updated if the original is not a related domain name."
		},
		{
			"Value":"http://login.asp.net/login/signout.aspx?id=5&ReturnUrl=http://www.asp.net/",
			"ExpectedValue": "http://login.asp.net/login/signout.aspx?id=5&ReturnUrl=http://www.asp.net/",
			Comments:"Test with ReturnUrl as the 2nd querystring parameter."
		},
		{
			"Value":"login/signout.aspx?ReturnUrl=//{WebServerDomain}/foo&id=5",
			"ExpectedValue": "login/signout.aspx?ReturnUrl=//{GatewayServerDomain}/{GatewaySubdir}foo&id=5",
			Comments:"ReturnUrl with relative base and relative ReturnURL."
		},
		{
			"Value":"http://login.asp.net/login/signout.aspx?ReturnUrl=//{WebServerDomain}/foo&id=5",
			"ExpectedValue": "http://login.asp.net/login/signout.aspx?ReturnUrl=//{GatewayServerDomain}/{GatewaySubdir}foo&id=5",
			Comments:"The ReturnUrl should be updated if the original is a related domain name."
		},
		{
			"Value":"https://login.live.com/login.srf?wa=wsignin1.0&...&wreply=http:%2F%2F{WebServerDomain}%2Fdefault.aspx...",
			"ExpectedValue": "https://login.live.com/login.srf?wa=wsignin1.0&...&wreply=http%3A%2F%2F{GatewayServerDomain}%2F{UrlEncodedGatewaySubDir}default.aspx... ",
			Comments:"When the ReturnUrl value is UrlEncoded then update the URL and UrlEncode it. Also test using wreply for the parameter name. Note: The http:%2F%2F in the original is 1/2 encoded. The result is fully encoded. The assumption is that this is ok, but if not then further work will need to be done to handle this situation."
		},
		{
			"Value":"https://serverfault.com/users/login?returnurl=http%3a%2f%2f{WebServerDomain}%2f...",
			"ExpectedValue": "https://serverfault.com/users/login?returnurl=http%3A%2F%2F{GatewayServerDomain}%2F{UrlEncodedGatewaySubDir}...",
			Comments:"Another test with UrlEncoded return Url. Test using returnurl for the parameter name."
		},
		{
			"Value":"https://www.amazon.com/ap/signin/...?_encoding=UTF8&openid.assoc...&openid.return_to=https%3A%2F%2F{WebServerDomain}%2F...",
			"ExpectedValue": "https://www.amazon.com/ap/signin/...?_encoding=UTF8&openid.assoc...&openid.return_to=https%3A%2F%2F{GatewayServerDomain}%2F{UrlEncodedGatewaySubDir}...",
			Comments:"Another test with UrlEncoded return Url. Test using openid.return_to."
		},




		{
			"Value":"javaScript:something",
			"ExpectedValue": "javaScript:something",
			Comments:"javaScript paths should be left untouched."
		},
		{
			"Value":"mailto:something",
			"ExpectedValue": "mailto:something",
			Comments:"mailto: paths should be left untouched."
		},
		{
			"Value":"https://{WebServerDomain}?something",
			"ExpectedValue": "https://{GatewayServerDomain}/{GatewaySubdir}?something",
			Comments:"Must support a ? immediately after the domain name."
		},
		{
			"Value":"https://{WebServerDomain}?something",
			"ExpectedValue": "https://{GatewayServerDomain}/{GatewaySubdir}?something",
			Comments:"Must support a # immediately after the domain name."
		},




		{
			"Value":"/scottsconfigs",
			"ExpectedValue": "/{GatewaySubdir}",
			Comments:"Todo: when testing a test that is in a subdir, the paths should be handled correctly."
		},
		{
			"Value":"/scottsconfigs/foo",
			"ExpectedValue": "/{GatewaySubdir}foo",
			Comments:"Todo: when testing a test that is in a subdir, the paths should be handled correctly."
		},
		{
			"Value":"/{GatewaySubdir}foo",
			"ExpectedValue": "/{GatewaySubdir}foo",
			Comments:"Todo: when testing a test that is in a subdir, the paths should be handled correctly."
		},
		{
			"Value":"/scottsconfigs/{GatewaySubdir}foo",
			"ExpectedValue": "/{GatewaySubdir}foo",
			Comments:"Todo: when testing a test that is in a subdir, the paths should be handled correctly."
		},
		{
			"Value":"/{GatewaySubdir}scottsconfigs/foo",
			"ExpectedValue": "/{GatewaySubdir}foo",
			Comments:"Todo: when testing a test that is in a subdir, the paths should be handled correctly."
		}
	]
}

